//
//  SYbuttonMoreTableViewCell.m
//  BSHOUYIFANG
//
//  Created by 曹雁彬 on 15/8/14.
//  Copyright (c) 2015年 CYB. All rights reserved.
//

#import "SYbuttonMoreTableViewCell.h"
#import "Header.h"
#import <UIImageView+WebCache.h>
#import "SYimageViewAddLable.h"
@implementation SYbuttonMoreTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        SYbuttonMoreTableViewCell *cell = self;
        _labelAddView1 = [[SYimageViewAddLable alloc]initWithFrame:CGRectMake(0, 10, SCREEN_WIDTH, SCREEN_HEIGHT/5)];
        //_labelAddView1.backgroundColor = [UIColor greenColor];
        _labelAddView1.webBlock = ^(NSInteger index){
            [cell webBlock:index-3001];
        };
        [self.contentView addSubview:_labelAddView1];
        

    }return self;
}
//block回调 C的方法
- (void)webBlock:(NSInteger)index
{
    if (_homeWebBlock != nil&&index==0) {
        _homeWebBlock(_model1.myID);
    }
    if (_homeWebBlock != nil&&index==1) {
        _homeWebBlock(_model2.myID);
    }
}
-(void)setModel1:(SYbuttonMore *)model1
{
    _model1 = model1;
    [_labelAddView1.bmgView1 sd_setImageWithURL:[NSURL URLWithString:_model1.img]];
    _labelAddView1.describe1.text = _model1.text;
    
    
}
-(void)setModel2:(SYbuttonMore *)model2
{
    _model2 = model2;
    
    [_labelAddView1.bmgView2 sd_setImageWithURL:[NSURL URLWithString:_model2.img]];
    _labelAddView1.describe2.text = _model2.text;
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
